var connect = require('connect');

connect().use(function(req,res,next){
  foo(''+10);
  res.end('hello,world!');
})
  .use(errHandle())
  .listen(3000);

  function errHandle(){
    return function(err,req,res,next){
      res.statusCode = 500;
      res.setHeader('Content-Type','application/json');
      res.end("err: "+JSON.stringify(err));
    }
  }

console.log('Your sever is start @3000');
